<?php
$tid = trim($_GET['tid'])==""?die("<a href='admin.php'>缺少关键参数</a>"):trim($_GET['tid']);


// 类型信息存入数据库
$db = mysqli_connect("localhost","root","123456","bbs");
$sql = "delete from type where tid=?";
$pr = $db->prepare($sql);
$pr->bind_param("i",$tid);
// 执行并判断是否成功执行
if($pr->execute()){
    session_start();
    $_SESSION["msg"] = "删除成功";
    header("location:admin.php");
}else{
    var_dump($pr->error_list);
    echo "删除失败";
}